//
//  NetworkManager.m
//  Furniture
//
//  Created by 王小娜 on 2017/3/14.
//  Copyright © 2017年 beyondSoft. All rights reserved.
//

#import "NetworkManager.h"
#import "Reachability.h"


@implementation NetworkManager

+ (NSString *)getCurrentNetwork{

    NSString *stateString = @"";    
    switch ([[Reachability   reachabilityForInternetConnection]currentReachabilityStatus]) {
        case NotReachable:
            stateString = @"NONE";
            break;
        case ReachableViaWiFi:
            stateString = @"wifi";
            break;
        case ReachableViaWWAN:
            stateString = @"WWAN";
            break;
        default:
            break;
    }
    if ([stateString isEqualToString:@""]) {
        stateString = @"NO DISPLAY";
    }


    return stateString;
}

#pragma mark - 判断是否有网络
+ (BOOL)isReachable {
    return [[Reachability reachabilityForInternetConnection] isReachable];
}

@end
